﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebNext.Domain.Entities;
using WebNext.Domain.Interfaces;

namespace WebNext.DataAccess.Repositories
{
	public class AdminSettingsRepository : EntitiesRepository<AdminSettings>, IAdminSettingsRepository
	{
		public AdminSettingsRepository(IDatabaseContext databaseContext) : base(databaseContext)
		{
		}

		public AdminSettings GetSettings()
		{
			return this.databaseContext.Session.QueryOver<AdminSettings>().OrderBy(s => s.CreatedOn).Desc.Take(1).SingleOrDefault();
		}
	}
}
